@extends('adminer.admin')
@section("style")
    <style>
        .btn{ padding: 3px 12px;}
        .btn-warning {float: right; position: relative; top:4px; right:10px;}
    </style>
@endsection
@section('content')
    <!-- BEGIN PAGE HEADER-->
    @include("adminer.public.bread")
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN SAMPLE TABLE widget-->
            <div class="widget">
                <div class="widget-title">
                    <h4><i class="icon-reorder"></i>{{$title}}</h4>
                    <a class="btn btn-warning" href="{{route('admin.create')}}"><i class="icon-plus icon-white"></i> 添加新用户</a>
                </div>
                <div class="widget-body" style="overflow: hidden">
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>角色</th>
                            <th class="hidden-phone">真实姓名</th>
                            <th>手机号</th>
                            <th>QQ号</th>
                            <th>注册时间</th>
                            <th>注册IP</th>
                            <th>最近登录时间</th>
                            <th>最近登录IP</th>
                            <th>登陆次数</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $info)
                        <tr>
                            <td>{{$info->id}}</td>
                            <td>{{$info->username}}</td>
                            <td>{{$info->role}}</td>
                            <td>{{$info->realname}}</td>
                            <td>{{$info->phone}}</td>
                            <td>{{$info->qq}}</td>
                            <td>{{$info->created_at}}</td>
                            <td>{{$info->create_ip}}</td>
                            <td>{{$info->lasttime}}</td>
                            <td>{{$info->lastip}}</td>
                            <td>{{$info->logincount}}</td>
                            <td><span @if($info->status == 2) class="label label-warning" @else  class="label label-info" @endif>@if($info->status == 2) 关闭 @else 启用 @endif</span></td>
                            <td><a href="{{route("admin.edit",$info->id)}}" title="编辑"><i class="icon-pencil"></i></a> &nbsp;<a href="javascript:;" onclick="del_forever($(this),'{{route("admin.destroy",$info->id)}}');" title="删除"><i class="icon-remove"></i></a></td>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
                    <div class="pagination" style="float:right;">
                        {{$list->appends(['keyword'=>session('keyword')])->render()}}
                    </div>
                </div>
            </div>
            <!-- END SAMPLE TABLE widget-->
        </div>
    </div>
    <!-- END PAGE CONTENT-->
@endsection
@section("script")
    <script>
        jQuery(document).ready(function() {
            // initiate layout and plugins
            App.init();
        });
    </script>
@endsection